const proxy = require('http-proxy-middleware');

module.exports = function(app) {
	//配置代理
  app.use(
    proxy('/demo',//请求前缀
			{
				target: 'http://localhost:5000', //代理把请求转发给谁
				pathRewrite:{'^/demo':''},
				changeOrigin: true,
			}
		),
		proxy('/test',//请求前缀
			{
				target: 'http://localhost:5001', //代理把请求转发给谁
				pathRewrite:{'^/test':''},
				changeOrigin: true,
			}
		)
  );
};